package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.TbProductSpecificationMapper;
import com.ruoyi.order.domain.TbProductSpecification;
import com.ruoyi.order.service.ITbProductSpecificationService;

/**
 * 商品规格-单价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-19
 */
@Service
public class TbProductSpecificationServiceImpl implements ITbProductSpecificationService 
{
    @Autowired
    private TbProductSpecificationMapper tbProductSpecificationMapper;

    /**
     * 查询商品规格-单价
     * 
     * @param id 商品规格-单价主键
     * @return 商品规格-单价
     */
    @Override
    public TbProductSpecification selectTbProductSpecificationById(Long id)
    {
        return tbProductSpecificationMapper.selectTbProductSpecificationById(id);
    }

    /**
     * 查询商品规格-单价列表
     * 
     * @param tbProductSpecification 商品规格-单价
     * @return 商品规格-单价
     */
    @Override
    public List<TbProductSpecification> selectTbProductSpecificationList(TbProductSpecification tbProductSpecification)
    {
        return tbProductSpecificationMapper.selectTbProductSpecificationList(tbProductSpecification);
    }

    /**
     * 新增商品规格-单价
     * 
     * @param tbProductSpecification 商品规格-单价
     * @return 结果
     */
    @Override
    public int insertTbProductSpecification(TbProductSpecification tbProductSpecification)
    {
        tbProductSpecification.setCreateTime(DateUtils.getNowDate());
        return tbProductSpecificationMapper.insertTbProductSpecification(tbProductSpecification);
    }

    /**
     * 修改商品规格-单价
     * 
     * @param tbProductSpecification 商品规格-单价
     * @return 结果
     */
    @Override
    public int updateTbProductSpecification(TbProductSpecification tbProductSpecification)
    {
        return tbProductSpecificationMapper.updateTbProductSpecification(tbProductSpecification);
    }

    /**
     * 批量删除商品规格-单价
     * 
     * @param ids 需要删除的商品规格-单价主键
     * @return 结果
     */
    @Override
    public int deleteTbProductSpecificationByIds(Long[] ids)
    {
        return tbProductSpecificationMapper.deleteTbProductSpecificationByIds(ids);
    }

    /**
     * 删除商品规格-单价信息
     * 
     * @param id 商品规格-单价主键
     * @return 结果
     */
    @Override
    public int deleteTbProductSpecificationById(Long id)
    {
        return tbProductSpecificationMapper.deleteTbProductSpecificationById(id);
    }
}
